import random

from game.card import Card
from game.config import suits, ranks


class Deck:

    def __init__(self):
        self.cards = [Card(suit, rank) for suit in suits for rank in ranks]
        self.shuffle()

    def shuffle(self):
        random.shuffle(self.cards)

    def deal(self, num=1):
        dealt_cards = self.cards[:num]
        self.cards = self.cards[num:]
        return dealt_cards
